﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Leasson6_CaseCode : MonoBehaviour
{
    public int count;
    public Rect scPos;
    public Vector2 nowPos;
    public Rect showPos;
    private void OnGUI()
    {
        //绘制之前通过字符串数组 动态的计算出内部显示的尺寸
        showPos.height = count * 30;
        nowPos = GUI.BeginScrollView(scPos, nowPos, showPos);
        for (int i=0; i< count; i++)
        {
            GUI.Label(new Rect(0, i * 30, 100, 30), i.ToString());
        }
        GUI.EndScrollView();
    }
}
